<HTML>
<HEAD>
<title>Atomic.Long.compareAndSet - </title>
<link rel="stylesheet" href="../../../style.css">
</HEAD>
<BODY>
<a href="../../index.html">org.mapdb</a>&nbsp;/&nbsp;<a href="../index.html">Atomic</a>&nbsp;/&nbsp;<a href="index.html">Long</a>&nbsp;/&nbsp;<a href=".">compareAndSet</a><br/>
<br/>
<h1>compareAndSet</h1>
<a name="org.mapdb.Atomic.Long$compareAndSet(kotlin.Long, kotlin.Long)"></a>
<code><span class="keyword">fun </span><span class="identifier">compareAndSet</span><span class="symbol">(</span><span class="identifier" id="org.mapdb.Atomic.Long$compareAndSet(kotlin.Long, kotlin.Long)/expect">expect</span><span class="symbol">:</span>&nbsp;<span class="identifier">Long</span><span class="symbol">, </span><span class="identifier" id="org.mapdb.Atomic.Long$compareAndSet(kotlin.Long, kotlin.Long)/update">update</span><span class="symbol">:</span>&nbsp;<span class="identifier">Long</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code><br/>
<p>Atomically sets the value to the given updated value if the current value <code>==</code> the expected value. </p>
<h3>Parameters</h3>
<a name="expect"></a>
<code>expect</code> - the expected value <br/>
<br/>
<a name="update"></a>
<code>update</code> - the new value <br/>
<p><strong>Return</strong><br/>
true if successful. False return indicates that the actual value was not equal to the expected value.</p>
<br/>
<br/>
</BODY>
</HTML>
